<include file="public/min-header"/>
<link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<div class="wrapper">
  <include file="public/breadcrumb"/>
  <section class="content">
    <div class="container-fluid">
      <div class="panel panel-default">
        <div class="panel-heading">
          <h3 class="panel-title"><i class="fa fa-list"></i>库存日志</h3>
        </div>
        <div class="panel-body">    
		<div class="navbar navbar-default">                    
                <form id="search-form2" class="navbar-form form-inline"  method="post" action="">
                <div class="form-group">
                  <label for="input-order-id" class="control-label">日志类型:</label>
                <div class="form-group">
                  <select class="form-control" id="status" name="mtype">                       
                    <option value="">全部</option>                    
                    <option value="1"<if condition="$_REQUEST['mtype'] eq 1">selected</if>>入库</option>
                    <option value="-1"<if condition="$_REQUEST['mtype'] eq -1">selected</if>>出库</option>
                  </select>
                </div>
                  <label for="input-order-id" class="control-label">商品名称:</label>                
                  <div class="input-group">
                    <input type="text" class="form-control" id="input-order-id" placeholder="商品名称" value="{$_REQUEST[goods_name]}" name="goods_name">                    
                  </div>
                   <div class="input-group margin">                    
                    <div class="input-group-addon">
                        	日志时间<i class="fa fa-calendar"></i>
                    </div>
                       <input type="text" id="start_time" value="{$ctime}" name="ctime" class="form-control pull-right" style="width:250px;">
                  </div>                  
                  
                </div>
                <div class="form-group">    
                    <button class="btn btn-primary" id="button-filter search-order" type="submit"><i class="fa fa-search"></i> 筛选</button>    
                </div>                                 
                </form>    
          </div>
                        
          <div id="ajax_return"> 
                 
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <th class="sorting text-left">编号</th>
                                <th class="sorting text-left">商品名称</th>
                                <th class="sorting text-left">商品规格</th>
                                <th class="sorting text-left">商家名称</th>
                                <th class="sorting text-left">订单号</th>
                                <th class="sorting text-left">库存</th>
                                <th class="sorting text-left">库存类型</th>
                                <th class="sorting text-left">操作人</th>                                
                                <th class="sorting text-left">日志时间</th>
                            </tr>
                            </thead>
                            <tbody>
                            <volist name="stock_list" id="v">
                                <tr>
                                    <td class="text-left">{$v.id}</td>
                                    <td class="text-left">{$v.goods_name|getSubstr=0,30}</td>
                                    <td class="text-left">{$v.goods_spec}</td>
                                    <td class="text-left">{$store[$v[store_id]]}</td>
                                    <td class="text-left">{$v.order_sn|default="N/A"}</td>
                                    <td class="text-left">{$v.stock}</td>
                                    <td class="text-left"><empty name="v[order_sn]">货品库存<else/>商品库存</empty></td>
                                    <td class="text-left">{$v.muid}</td>                                    
                                    <td class="text-left">{$v.ctime|date="Y-m-d H:i:s",###}</td>
                                </tr>
                            </volist>
                            </tbody>
                        </table>
                    </div>
                
                <div class="row">
                    <div class="col-sm-6 text-left"></div>
                    <div class="col-sm-6 text-right">{$page}</div>
                </div>
          
          </div>
        </div>
      </div>
    </div>
    <!-- /.row --> 
  </section>
  <!-- /.content --> 
</div>
<!-- /.content-wrapper --> 
 <script> 
$(document).ready(function() {
	$('#start_time').daterangepicker({
		format:"YYYY-MM-DD",
		singleDatePicker: false,
		showDropdowns: true,
		minDate:'2016-10-01',
		maxDate:'2030-01-01',
		startDate:'<?php echo date("Y-m",strtotime("-1 month"));?>-01',
        opens: 'right',
        ranges: {
            '今天': [moment(), moment()],
            '昨天': [moment().subtract('days', 1), moment().subtract('days', 1)],
            '最近7天': [moment().subtract('days', 6), moment()],
            '最近30天': [moment().subtract('days', 29), moment()],
            '上一个月': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
        },
	    locale : {
            applyLabel : '确定',
            cancelLabel : '取消',
            fromLabel : '起始时间',
            toLabel : '结束时间',
            customRangeLabel : '自定义',
            daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
            monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月','七月', '八月', '九月', '十月', '十一月', '十二月' ],
            firstDay : 1
        }
	});
});
</script>
</body>
</html>